<template>
	<view>
		<view class="head">
			<view class="head-title">账户余额 (元)</view>
			<view class="head-item">
				<view class="head-price">
					{{nowprice}}
				</view>
				<view class="head-topUp" @click="gotoPage('/pagesUser/user/my-wallet/sykpe/sykpe')">
					立即充值
				</view>
			</view>
		</view>
		<view class="line"></view>
		<view class="item">
			<view class="item-con" @click="gotoPage('/pagesUser/user/my-wallet/withdraw/withdraw')">
				<view>立即提现</view>
				<image src="../../../static/jiantou3.png"></image>
			</view>
			<view class="item-con" @click="gotoPage('/pagesUser/user/my-wallet/dealingSlip/dealingSlip')">
				<view>提现记录</view>
				<image src="../../../static/jiantou3.png"></image>
			</view>
			<view class="item-con" @click="gotoPage('/pagesUser/user/my-wallet/recharge/recharge')">
				<view>充值记录</view>
				<image src="../../../static/jiantou3.png"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				nowprice:'',//账户余额
			};
		},
		onLoad() {
			
		},
		onShow() {
			this.getData();
		},
		onPullDownRefresh() {
			this.getData();
			setTimeout(() => {
				uni.stopPullDownRefresh();
			}, 1000);
		},
		methods:{
			/*获取余额数据*/
			getData() {
				let self = this;
				uni.showLoading({
					title: '加载中'
				});
				self._get(
					'user.index/my_money',
					{
						
					},
					function(data) {
						//console.log(data);
						self.tableData = data.data.list;
						self.nowprice = self.tableData.balance;
						//console.log(self.nowprice)
						//this.loading = true;
						uni.hideLoading();
					}
				);
			},
			gotoPage(path) {
				let self = this;
				if (path.startsWith('/')) {
					uni.navigateTo({
						url: path
					});
				} else {
					self[path]();
				}
			},
		},
	}
</script>

<style lang="scss">
	.head{
		width: 88%;
		height: 300rpx;
		margin: 30rpx auto;
		//background-color: #00B26A;
		background: url(../../../static/user/walletbg2.png) 0 0/100% 100%;
		color: #FFFFFF;
		overflow: hidden;
		padding: 0 30rpx;
	}
	.head-title{
		margin-top: 60rpx;
	}
	.head-item{
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-top: 30rpx;
	}
	.head-price{
		font-size: 38rpx;
		font-weight: 900;
	}
	.head-topUp{
		background-color: #FFFFFF;
		padding: 6rpx 16rpx;
		color: #1546FA;
		border-radius: 30rpx;
	}
	.line{
		width: 100%;
		height: 20rpx;
		margin-top: 60rpx;
		background-color: #F4F8FC;
	}
	.item{
		padding: 0 40rpx;
	}
	.item-con{
		//width: 80%;
		padding: 40rpx 0;
		border-bottom: 1rpx solid #F4F4F4;
		display: flex;
		align-items: center;
		justify-content: space-between;
		font-size: 28rpx;
	}
	.item-con image{
		width: 40rpx;
		height: 40rpx;
	}
</style>
